/**
 * Buffer转Blob URL
 * @param {String} buf Buffer数据
*/
const buffer2blobUrl = (buf, mimeType) => {
  let result = ''
  let bufferData = new Uint8Array(buf)
  let blobData = new Blob([bufferData], { type: mimeType })
  result = URL.createObjectURL(blobData)
  return result
}


let toolsElectron = {
    buffer2blobUrl,
}

module.exports = (jstools) => {
    for (let k in toolsElectron) {
        jstools[k] = toolsElectron[k]
    }
}
